CXX = g++
CXXFLAGS = -Wall
LINKER = g++
LFLAGS =

folder_name = ${notdir ${abspath .}}

lib_filename = lib${folder_name}.a

.PHONY : static_library
static_library : ${lib_filename}

.PHONY : TEST
TEST : test.exe

Objects = EmbeddedJavaVM.o JvmDllLoader.o JavaVmInitArg.o

EmbeddedJavaVM.o : EmbeddedJavaVM.cpp EmbeddedJavaVM.h
	${CXX} -c $< -o $@ ${CXXFLAGS}

JvmDllLoader.o : JvmDllLoader.cpp JvmDllLoader.h
	${CXX} -c $< -o $@ ${CXXFLAGS}

JavaVmInitArg.o : JavaVmInitArg.cpp JavaVmInitArg.h
	${CXX} -c $< -o $@ ${CXXFLAGS}

test.o : test.cpp
	${CXX} -c $< -o $@ ${CXXFLAGS}

${lib_filename} : ${Objects}
	ar cqs $@ $^

test.exe : test.o ${Objects}
	${LINKER} ${LFLAGS} $^ -o $@

.PHONY : clean
clean :
	rm -rf *.o *.a *.exe
